import { getUserFromCookie } from '@/lib/auth';
import Right from './Right';
import http, { baseUrl } from '@/lib/request';
import { ApiResponse, MessageBase, MessageData } from '@/types/interface';

const HomeLayer: React.FC<{ id: string }> = async ({ id }) => {
	const token = await getUserFromCookie();

	const messages = await http
		.get(baseUrl + '/perf/session/messgaes/' + id, {
			headers: { Authorization: `Bearer ${token}` },
		})
		.then((res) => {
			const result = res as ApiResponse<MessageData>;
			console.log(result);
			return result.data;
		});
	return (
		<>
			<Right></Right>
		</>
	);
};

export default HomeLayer;
